<div id="map-container">
    <!-- Map Here -->
</div>

<nav id="second-nav">
    <div class="container">
        <form action="<?php echo site_url("Home/search_process") ?>" method="POST">
            <div class="col-md-10">
                <select class="form-control input-lg" name="src_location">
                    <option value="">Select Location</option>
                    <option value="all">All Location</option>
                    <?php foreach ($select_location as $data) { ?>
                        <option value="<?php echo $data['location_name'] ?>"><?php echo $data['location_name'] ?></option>
                    <?php } ?>
                </select>
            </div>
            <div class="col-md-2">
                <button class="btn btn-lg btn-blue" type="submit" name="btn_src_location" value="search">Search</button>
            </div>                    
        </form>
    </div>
</nav>

<div id="content-outer" class="single-content">
    <div class="container">
        <div id="main" class="col-md-8">
            <ol class="breadcrumb">
                <li><a href="<?php echo site_url() ?>">Home</a></li>
                <li>Search</li>
                <li><?php echo $location ?></li>
            </ol>
            
            <?php foreach ($post_by_location as $data) { ?>
                <div class="post-outer">
                    <div class="thumb-container col-md-6">
                        <img src="<?php echo base_url() ?>/Images/Post_Thumb/<?php echo $data['thumbnail'] ?>" class="img-responsive post-thumb" width="100%"/>
                        <i class="ico-search fa fa-<?php echo $data['category_icon'] ?>" style="background-color: <?php echo $data['category_color']?>"></i>
                    </div>
                    <div class="detail col-md-6">
                        <h2 class="home-post-title">
                            <a href="<?php echo site_url("Home/post/$data[id_post]") ?>"><?php echo $data['post_title'] ?></a>
                        </h2>
                        <div class="post-detail">
                            <span>
                                <i class="fa fa-user"></i> <?php echo $data['fullname_user'] ?>
                            </span> 
                            <span>
                                <i class="fa fa-calendar"></i> <?php echo substr($data['post_date'], 0, 10) ?>
                            </span>
                        </div>  
                    </div>
                </div>
            <?php } ?>

            <?php if(count($post_by_location) <= 0 && $this->uri->segment(3) != "page"): ?>
                <div class="alert alert-danger" style="text-align:center;text-transform:capitalize;">
                    <i class="fa fa-bell-slash fa-3x"></i><br/>
                    No Post Found Under <?php echo $this->uri->segment(3) ?>. View <a href="<?php echo site_url('Home/search/all') ?>">All Posts</a> 
                </div>
            <?php endif; ?>
            <?php echo $halaman; ?>
        </div>
        
        <!-- Include the Sidebar (i_sidebar.php)-->
        <?php $this->load->view('Home_inc/i_sidebar') ?>
    </div><!-- /.content-outer -->        
</div><!-- /#content-outer -->